function [grid]=gslib2grid(gsl_array,XMAX,YMAX,ZMAX)
% CONVERTS A GSLIB ARRAY INTO A MATRIX WITH DIMENSION {XMAX,YMAX,ZMAX} %
%
% GSL_array - NUMERIC DATA FROM A GSLIB FILE
% XMAX - MAXIMUM CELLS IN THE X-DIRECTION
% YMAX - MAXIMUM CELLS IN THE Y-DIRECTION
% ZMAX - MAXIMUM CELLS IN THE Z-DIRECTION
% grid - XMAX x YMAX x ZMAX MATRIX
%
% MODIFICATIONS:
% 18 OCT 2012 - PERFORMANCE UPDATE. MATCH STOCHASTIC CODE.
%
% v1.0 - LA - FEB 2012


%% BODY
grid=reshape(gsl_array(:,1),XMAX,YMAX,ZMAX);

end
